package org.xiyinjihe.platform.util;

public class PasswordUtil {

    public static String convertPassword(String userCode, String password) {
        password = password.toLowerCase();
        if (password.trim().length() <= 7) {
            return password;
        }
        String firstPwd = password.trim().substring(7, password.trim().length()-1);
        StringBuffer sb = new StringBuffer();
        sb.append(firstPwd).append(userCode);
        String shaPwd = Sha1Util.encode(sb.toString());
        String pwd = Md5Util.encrypt(shaPwd, "LCase");
        return pwd;
    }
}